package pascal

const testVersion = 1

func Triangle(input int) (r [][]int) {
	r = make([][]int, input)
	for i := 0; i < input; i++ {
		r[i] = make([]int, i+1)
		for j := 0; j < len(r[i]); j++ {
			if j == 0 || j == len(r[i])-1 {
				r[i][j] = 1
				continue
			}
			if i > 0 {
				r[i][j] = r[i-1][j-1] + r[i-1][j]
			}
		}
	}
	return r
}
